/*
 * @Author: your name
 * @Date: 2021-04-01 16:34:05
 * @LastEditTime: 2021-04-16 10:07:58
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \web\node\models\Sowing.js
 */
/* 轮播图的模式对象 */
import mongoose from "mongoose"

const sourceSchema = mongoose.Schema({
    // 标题
    title: {type: String, required: true},
    // 作者
    author: {type: String, required: true},
    // 缩略图
    small_img: {type: String,  required: true},
    // 是否收藏  0 不收藏 1 收藏
    is_store: {type: String, default: '0'},
    // 价格 0 免费
    price: {type: Number, default: 0},
    // 阅读次数
    read_count: {type: Number, default: 1},
    // 添加日期
    add_time: {type: Date, default: Date.now},
    // 文章内容
    content: {type: String, required: true},
    // 最后编辑时间
    l_time: {type: Date, default: Date.now}
})

const Source = mongoose.model("source",sourceSchema);
export default Source;